/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = 'regional';
  
  checkConfig(config);
  @endpoint = getEndpoint('emas-appmonitor', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model ConditionalRule {
  filter?: EventFilter(name='Filter'),
  modifyTime?: string(name='ModifyTime'),
  name?: string(name='Name'),
  operator?: string(name='Operator'),
  sampleRate?: float(name='SampleRate'),
}

model EventFilter {
  key?: string(name='Key'),
  op?: string(name='Op', description='This parameter is required.'),
  subFilters?: [
    EventFilter
  ](name='SubFilters'),
  values?: [ string ](name='Values'),
}

model EventRule {
  conditional?: [
    ConditionalRule
  ](name='Conditional'),
  enable?: boolean(name='Enable'),
  eventId?: string(name='EventId'),
  modifyTime?: string(name='ModifyTime'),
  operator?: string(name='Operator'),
  sampleRate?: float(name='SampleRate'),
}

model Filter {
  key?: string(name='Key'),
  operator?: string(name='Operator'),
  subFilters?: [
    Filter
  ](name='SubFilters'),
  values?: any(name='Values'),
}

model FullSampleItem {
  id?: string(name='Id'),
  modifyTime?: string(name='ModifyTime'),
  operator?: string(name='Operator'),
}

model SampleBase {
  fullSampleDeviceIds?: [
    FullSampleItem
  ](name='FullSampleDeviceIds'),
  fullSampleUsers?: [
    FullSampleItem
  ](name='FullSampleUsers'),
  sampleMethod?: string(name='SampleMethod'),
  sampleRate?: float(name='SampleRate'),
}

model GetErrorRequest {
  appKey?: long(name='AppKey', description='appKey

This parameter is required.', example='233588686'),
  bizModule?: string(name='BizModule', example='h5Resource'),
  clientTime?: long(name='ClientTime', description='This parameter is required.', example='1739808000000'),
  did?: string(name='Did', example='233588686'),
  force?: boolean(name='Force', example='false'),
  os?: string(name='Os', example='android'),
  uuid?: string(name='Uuid', example='abcf4a4b-158c-4a0b-b81c-262785d84c4f'),
}

model GetErrorResponseBody = {
  args?: map[string]any(name='Args'),
  errorCode?: int32(name='ErrorCode', example='Success'),
  message?: string(name='Message', example='Successful'),
  model?: {
    access?: string(name='Access', example='4G'),
    accessSubType?: string(name='AccessSubType', example='null'),
    additionalCallbackInfo?: string(name='AdditionalCallbackInfo', example='-'),
    additionalCrossPlatformCrashInfo?: string(name='AdditionalCrossPlatformCrashInfo', example='-'),
    additionalCustomInfo?: string(name='AdditionalCustomInfo', example='-'),
    androidVm?: string(name='AndroidVm', example='-'),
    appId?: string(name='AppId', example='ALIPUBDC3CA71131027'),
    appKey?: long(name='AppKey', description='appKey', example='233588686'),
    appVersion?: string(name='AppVersion', example='V20250224102631'),
    argHash?: long(name='ArgHash', example='-'),
    args?: string(name='Args', example='h=60'),
    backtrace?: string(name='Backtrace', example='java.lang.NullPointerException: Attempt to invoke virtual method \\\\"java.lang.Object'),
    banner?: string(name='Banner', description='banner', example='-'),
    binaryUuids?: string(name='BinaryUuids', example='-'),
    brand?: string(name='Brand', example='Hinova'),
    browserName?: string(name='BrowserName', example='Chrome'),
    browserVersion?: string(name='BrowserVersion'),
    build?: string(name='Build', example='100'),
    businessCountry?: string(name='BusinessCountry', example='china'),
    businessErrorExtData?: string(name='BusinessErrorExtData', example='-'),
    businessLogType?: string(name='BusinessLogType', example='-'),
    carrier?: string(name='Carrier', description='carrier', example='CT'),
    channel?: string(name='Channel', example='ant'),
    city?: string(name='City', example='375'),
    clientIp?: string(name='ClientIp', example='100.104.16.217:51534'),
    clientTime?: long(name='ClientTime', example='1739808000000'),
    colNo?: string(name='ColNo', example='0'),
    country?: string(name='Country', example='CN'),
    cpuModel?: string(name='CpuModel', example='arm'),
    cruxModule?: string(name='CruxModule', example='-'),
    cruxStack?: string(name='CruxStack', example='-'),
    cruxStackHash?: long(name='CruxStackHash', example='-'),
    cruxStackTrace?: string(name='CruxStackTrace', description='CruxStackTrace', example='-'),
    cruxStackTraceHash?: long(name='CruxStackTraceHash', example='-'),
    customExceptionType?: string(name='CustomExceptionType', example='-'),
    customInfo?: string(name='CustomInfo', example='-'),
    dataDirectory?: string(name='DataDirectory', example='-'),
    deviceId?: string(name='DeviceId', example='ad-0001t9c1b6y48kqcd44s-105'),
    deviceModel?: string(name='DeviceModel', example='ASUS_X00GD'),
    did?: string(name='Did', example='22jtJ213saqfB1yBgBKhayYPwcZ2'),
    digest?: string(name='Digest', example='sha256:b3b79f1f6c2beca7ac93a9518a35d542e0bfeb7ae64c9e57e9edd4719489927c'),
    digestHash?: string(name='DigestHash', example='-'),
    domScore?: string(name='DomScore', example='0.5'),
    downloadCacheDirectory?: string(name='DownloadCacheDirectory', example='-'),
    errorName?: string(name='ErrorName', example='OOM'),
    errorType?: string(name='ErrorType', example='jsError'),
    eventId?: int32(name='EventId', example='0DB-22jtJZzBvqfB1yBgBKhayYPwcZ2'),
    eventLog?: string(name='EventLog', example='-'),
    exceptionArg1?: string(name='ExceptionArg1', example='-'),
    exceptionArg2?: string(name='ExceptionArg2', example='-'),
    exceptionArg3?: string(name='ExceptionArg3', example='-'),
    exceptionCode?: string(name='ExceptionCode', example='-'),
    exceptionCodes?: string(name='ExceptionCodes', example='-'),
    exceptionDetail?: string(name='ExceptionDetail', example='-'),
    exceptionId?: string(name='ExceptionId', example='-'),
    exceptionMsg?: string(name='ExceptionMsg', example='Table \\\\"123_temp.image_vw_6191426\\\\" doesn\\\\"t exist'),
    exceptionSubtype?: string(name='ExceptionSubtype', example='-'),
    exceptionType?: string(name='ExceptionType', example='-'),
    exceptionVersion?: string(name='ExceptionVersion', example='-'),
    exportStatus?: string(name='ExportStatus', example='exporting'),
    externalStorageDirectory?: string(name='ExternalStorageDirectory', example='-'),
    featureScene?: string(name='FeatureScene', example='-'),
    fileName?: string(name='FileName', example='baselineCspm_20241005'),
    filePath?: string(name='FilePath', example='dubhe-service/src/main/java/com/viatris/dubhe/monitortask/service/Impl/DataSyncMonitorRecordServiceImpl.java'),
    filename?: string(name='Filename', example='chunk-56494f41.3df8bd75.css'),
    flutterRoute?: string(name='FlutterRoute', example='-'),
    forceGround?: int32(name='ForceGround', example='1'),
    foreGround?: int32(name='ForeGround', example='1'),
    h5FullUrl?: string(name='H5FullUrl', example='-'),
    h5ShortUrl?: string(name='H5ShortUrl', example='-'),
    hasOpenMultiProcessMode?: int32(name='HasOpenMultiProcessMode', example='0'),
    hasSdCard?: int32(name='HasSdCard', example='-'),
    hasSgSecurityConfigKey?: int32(name='HasSgSecurityConfigKey', example='0'),
    imei?: string(name='Imei', description='IMEI', example='2704b9b0d94b2f3897f82119a1900cd9c7a8108d'),
    imsi?: string(name='Imsi', description='IMSI', example='460049842500442'),
    inMainProcess?: int32(name='InMainProcess', example='0'),
    installSdCard?: int32(name='InstallSdCard', example='-'),
    isBackTrace?: int32(name='IsBackTrace', example='-'),
    isSpeedVersion?: int32(name='IsSpeedVersion', example='0'),
    isp?: string(name='Isp', description='ISP', example='cmcc'),
    jsBacktrace?: string(name='JsBacktrace', example='java.lang.NullPointerException: Attempt to invoke virtual method \\\\"java.lang.Object'),
    language?: string(name='Language', example='cn'),
    launchedTime?: string(name='LaunchedTime', example='2025-02-25 18:02:50'),
    lineNo?: string(name='LineNo', example='0'),
    logHash?: long(name='LogHash', example='-'),
    mainLog?: string(name='MainLog', example='-'),
    memoryMap?: string(name='MemoryMap', example='-'),
    moreInfo1?: string(name='MoreInfo1', example='-'),
    moreInfo2?: string(name='MoreInfo2', example='-'),
    moreInfo3?: string(name='MoreInfo3', example='-'),
    nativeAllThreadDump?: string(name='NativeAllThreadDump', example='-'),
    nativeMaps?: string(name='NativeMaps', description='Native map', example='-'),
    needReCluster?: int32(name='NeedReCluster', example='-'),
    openedFileCount?: int32(name='OpenedFileCount', example='-'),
    operations?: string(name='Operations', example='[{\\\\"status\\\\":1,\\\\"target\\\\":\\\\"5461e0ab-340f-4a6b-9bbe-f75e44985420\\\\"}]'),
    originData?: string(name='OriginData', example='[]'),
    originUri?: string(name='OriginUri', example='-'),
    os?: string(name='Os', example='android'),
    osVersion?: string(name='OsVersion', example='1'),
    page?: string(name='Page', example='{\\\\"Content\\\\": [], \\\\"TotalPages\\\\": 2, \\\\"TotalItems\\\\": 31, \\\\"PageNumber\\\\": 4, \\\\"PageSize\\\\": 20}'),
    parentProcessName?: string(name='ParentProcessName', example='com.aliyun.demo'),
    pid?: int32(name='Pid', example='ce0ak81asd@62706c656a7f1a1'),
    platform?: string(name='Platform', example='wechat'),
    processName?: string(name='ProcessName', example='null'),
    province?: string(name='Province'),
    reason?: string(name='Reason'),
    reportContent?: string(name='ReportContent', example='-'),
    reportType?: string(name='ReportType', example='2'),
    resolution?: string(name='Resolution', example='720*1280'),
    rootDirectory?: string(name='RootDirectory', example='-'),
    runtimeExtData?: string(name='RuntimeExtData', example='-'),
    sceneValue?: string(name='SceneValue', example='-'),
    sdkType?: string(name='SdkType', example='software_nls_tts_offline_standard'),
    sdkVersion?: string(name='SdkVersion', example='5.2.3'),
    seq?: string(name='Seq', example='3481243636390427020'),
    serverTime?: long(name='ServerTime', example='1739808000000'),
    sessionId?: string(name='SessionId', example='9ec8e399-51cc-4283-8ba4-f6df78246249'),
    simpleReportContent?: string(name='SimpleReportContent', example='-'),
    soLibBuild?: string(name='SoLibBuild', example='-'),
    speedFlags?: string(name='SpeedFlags', description='SpeedFlags', example='-'),
    stack?: string(name='Stack', example='java.lang.NullPointerException: Attempt to invoke virtual method \\\\"java.lang.Object java.lang.ref.WeakReference.get()\\\\" on a null object reference'),
    status?: string(name='Status', example='success'),
    summary?: string(name='Summary', example='{\\\\"HandledCheckToday\\\\": 0, \\\\"RiskCheckCnt\\\\": 34, \\\\"RiskWarningCnt\\\\": 57, \\\\"RiskDays\\\\": 30, \\\\"HandledCheckTotal\\\\": 5, \\\\"HandledDays\\\\": 365}'),
    symbolicFileType?: string(name='SymbolicFileType', example='-'),
    sysLog?: string(name='SysLog', example='-'),
    threadName?: string(name='ThreadName', example='null'),
    threads?: string(name='Threads', example='Process Name: \\\\"com.muyuan.mytongdriver\\\\"
Thread Name: \\\\"main\\\\"'),
    tid?: int32(name='Tid', example='2359'),
    track?: string(name='Track', example='-'),
    triggeredTime?: string(name='TriggeredTime', example='2025-02-25 18:02:50'),
    uploadTime?: long(name='UploadTime', example='1740412800000'),
    uri?: string(name='Uri', description='URI', example='https://oss.aliyuncs.com/aliyun_id_photo_bucket/default_handsome.jpg'),
    user?: string(name='User', example='-'),
    userId?: string(name='UserId', example='1'),
    userNick?: string(name='UserNick', example='mark'),
    utdid?: string(name='Utdid', description='utdid', example='2704b9b0d94b2f3897f82119a'),
    uuid?: string(name='Uuid', description='uuid', example='105a87c6-f299-42e5-8fc7-1066a47a96e5'),
    view?: string(name='View', description='view', example='com.aliyun.view1'),
    weexFullUrl?: string(name='WeexFullUrl', example='-'),
    weexShortUrl?: string(name='WeexShortUrl', example='-'),
    writeLimit?: int32(name='WriteLimit', example='-'),
  }(name='Model'),
  requestId?: string(name='RequestId', example='A8313212-EB4E-4E15-A7F9-D9C8F3FE8E94'),
  success?: boolean(name='Success', example='True'),
}

model GetErrorResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetErrorResponseBody(name='body'),
}

/**
 * @summary 获取错误事件详情
 *
 * @param request GetErrorRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetErrorResponse
 */
async function getErrorWithOptions(request: GetErrorRequest, runtime: Util.RuntimeOptions): GetErrorResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.appKey)) {
    body['AppKey'] = request.appKey;
  }
  if (!Util.isUnset(request.bizModule)) {
    body['BizModule'] = request.bizModule;
  }
  if (!Util.isUnset(request.clientTime)) {
    body['ClientTime'] = request.clientTime;
  }
  if (!Util.isUnset(request.did)) {
    body['Did'] = request.did;
  }
  if (!Util.isUnset(request.force)) {
    body['Force'] = request.force;
  }
  if (!Util.isUnset(request.os)) {
    body['Os'] = request.os;
  }
  if (!Util.isUnset(request.uuid)) {
    body['Uuid'] = request.uuid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetError',
    version = '2019-06-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取错误事件详情
 *
 * @param request GetErrorRequest
 * @return GetErrorResponse
 */
async function getError(request: GetErrorRequest): GetErrorResponse {
  var runtime = new Util.RuntimeOptions{};
  return getErrorWithOptions(request, runtime);
}

model GetErrorsRequest {
  appKey?: long(name='AppKey', description='appKey

This parameter is required.', example='24780725'),
  bizModule?: string(name='BizModule', description='This parameter is required.', example='crash'),
  digestHash?: string(name='DigestHash', example='-3481243636390427020'),
  filter?: {
    key?: string(name='Key', example='osVersion'),
    operator?: string(name='Operator', example='and'),
    subFilters?: [ string ](name='SubFilters'),
    values?: [ any ](name='Values'),
  }(name='Filter'),
  os?: string(name='Os', example='android'),
  pageIndex?: int32(name='PageIndex', description='This parameter is required.', example='1'),
  pageSize?: int32(name='PageSize', description='This parameter is required.', example='10'),
  timeRange?: {
    endTime?: long(name='EndTime', description='This parameter is required.', example='1740499200000'),
    startTime?: long(name='StartTime', description='This parameter is required.', example='1739894400000'),
  }(name='TimeRange', description='This parameter is required.'),
  utdid?: string(name='Utdid', description='utdid', example='Z70g6V/MXJ8DABtD53eHzn4X'),
}

model GetErrorsShrinkRequest {
  appKey?: long(name='AppKey', description='appKey

This parameter is required.', example='24780725'),
  bizModule?: string(name='BizModule', description='This parameter is required.', example='crash'),
  digestHash?: string(name='DigestHash', example='-3481243636390427020'),
  filterShrink?: string(name='Filter'),
  os?: string(name='Os', example='android'),
  pageIndex?: int32(name='PageIndex', description='This parameter is required.', example='1'),
  pageSize?: int32(name='PageSize', description='This parameter is required.', example='10'),
  timeRange?: {
    endTime?: long(name='EndTime', description='This parameter is required.', example='1740499200000'),
    startTime?: long(name='StartTime', description='This parameter is required.', example='1739894400000'),
  }(name='TimeRange', description='This parameter is required.'),
  utdid?: string(name='Utdid', description='utdid', example='Z70g6V/MXJ8DABtD53eHzn4X'),
}

model GetErrorsResponseBody = {
  args?: map[string]any(name='Args', description='Args'),
  errorCode?: int32(name='ErrorCode', example='500'),
  message?: string(name='Message', example='internal error'),
  model?: {
    items?: [ 
      {
        clientTime?: long(name='ClientTime', example='1740488561065'),
        did?: string(name='Did', example='RANDOM-1729634758587856312DEVICE'),
        utdid?: string(name='Utdid', description='Utdid', example='RANDOM-1729634758587856312DEVICE'),
        uuid?: string(name='Uuid', example='9634758587856312DEV'),
      }
    ](name='Items'),
    pageNum?: int32(name='PageNum', example='10'),
    pageSize?: int32(name='PageSize', example='10'),
    pages?: int32(name='Pages', example='1'),
    total?: long(name='Total', example='10'),
  }(name='Model'),
  requestId?: string(name='RequestId', description='RequestId', example='B3AD0FE4-36EF-1641-90B1-77618166F2ff'),
  success?: boolean(name='Success', example='true'),
}

model GetErrorsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetErrorsResponseBody(name='body'),
}

/**
 * @summary 获取某一聚合错误下所有的错误事件列表
 *
 * @param tmpReq GetErrorsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetErrorsResponse
 */
async function getErrorsWithOptions(tmpReq: GetErrorsRequest, runtime: Util.RuntimeOptions): GetErrorsResponse {
  Util.validateModel(tmpReq);
  var request = new GetErrorsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.filter)) {
    request.filterShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.filter, 'Filter', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appKey)) {
    body['AppKey'] = request.appKey;
  }
  if (!Util.isUnset(request.bizModule)) {
    body['BizModule'] = request.bizModule;
  }
  if (!Util.isUnset(request.digestHash)) {
    body['DigestHash'] = request.digestHash;
  }
  if (!Util.isUnset(request.filterShrink)) {
    body['Filter'] = request.filterShrink;
  }
  if (!Util.isUnset(request.os)) {
    body['Os'] = request.os;
  }
  if (!Util.isUnset(request.pageIndex)) {
    body['PageIndex'] = request.pageIndex;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  var bodyFlat : map[string]any = {};
  if (!Util.isUnset(request.timeRange)) {
    bodyFlat['TimeRange'] = request.timeRange;
  }
  if (!Util.isUnset(request.utdid)) {
    body['Utdid'] = request.utdid;
  }
  body = {
    ...body,
    ...OpenApiUtil.query(bodyFlat),
  };

  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetErrors',
    version = '2019-06-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取某一聚合错误下所有的错误事件列表
 *
 * @param request GetErrorsRequest
 * @return GetErrorsResponse
 */
async function getErrors(request: GetErrorsRequest): GetErrorsResponse {
  var runtime = new Util.RuntimeOptions{};
  return getErrorsWithOptions(request, runtime);
}

model GetIssueRequest {
  appKey?: long(name='AppKey', description='AppKey

This parameter is required.', example='233588686'),
  bizModule?: string(name='BizModule', description='This parameter is required.', example='h5Resource'),
  digestHash?: string(name='DigestHash', example='2963475858785631'),
  filter?: {
    key?: string(name='Key', example='MySQL_IOPS'),
    operator?: string(name='Operator', example='Equal'),
    subFilters?: [ string ](name='SubFilters'),
    values?: [ any ](name='Values'),
  }(name='Filter'),
  os?: string(name='Os', description='This parameter is required.', example='h5'),
  timeRange?: {
    endTime?: long(name='EndTime', example='2024-08-23T02:12:00Z'),
    granularity?: int32(name='Granularity', example='Host'),
    granularityUnit?: string(name='GranularityUnit', example='minute'),
    startTime?: long(name='StartTime', example='2024-12-18 00:00:00'),
  }(name='TimeRange', description='This parameter is required.'),
}

model GetIssueShrinkRequest {
  appKey?: long(name='AppKey', description='AppKey

This parameter is required.', example='233588686'),
  bizModule?: string(name='BizModule', description='This parameter is required.', example='h5Resource'),
  digestHash?: string(name='DigestHash', example='2963475858785631'),
  filterShrink?: string(name='Filter'),
  os?: string(name='Os', description='This parameter is required.', example='h5'),
  timeRange?: {
    endTime?: long(name='EndTime', example='2024-08-23T02:12:00Z'),
    granularity?: int32(name='Granularity', example='Host'),
    granularityUnit?: string(name='GranularityUnit', example='minute'),
    startTime?: long(name='StartTime', example='2024-12-18 00:00:00'),
  }(name='TimeRange', description='This parameter is required.'),
}

model GetIssueResponseBody = {
  args?: map[string]any(name='Args', description='Args'),
  errorCode?: int32(name='ErrorCode', example='200'),
  message?: string(name='Message', example='Successful'),
  model?: {
    affectedVersions?: [ string ](name='AffectedVersions'),
    cruxStack?: string(name='CruxStack', example='java.lang.NullPointerException: Attempt to invoke virtual method \\\\"java.lang.Object java.lang.ref.WeakReference.get()\\\\" on a null object reference
	at e.l.a.a.d.h(BasePresenter.java:1)
	at e.l.a.g.c.e.g.s1(GoodsPigLoadPresenter.java:1)
	at e.l.a.h.d.a$a.a(AliOssManager.java:2)'),
    digestHash?: string(name='DigestHash', example='-6428474329608402395'),
    errorColumn?: int32(name='ErrorColumn', example='2'),
    errorCount?: int32(name='ErrorCount', example='2'),
    errorCountGrowthRate?: double(name='ErrorCountGrowthRate', example='0.2'),
    errorDeviceCount?: int32(name='ErrorDeviceCount', example='4'),
    errorDeviceCountGrowthRate?: double(name='ErrorDeviceCountGrowthRate', example='0.2'),
    errorDeviceRate?: double(name='ErrorDeviceRate', example='0.2'),
    errorDeviceRateGrowthRate?: double(name='ErrorDeviceRateGrowthRate', example='0.2'),
    errorFileName?: string(name='ErrorFileName', example='test.js'),
    errorLine?: string(name='ErrorLine', example='1'),
    errorName?: string(name='ErrorName', example='Error'),
    errorRate?: double(name='ErrorRate', example='0'),
    errorRateGrowthRate?: double(name='ErrorRateGrowthRate', example='0.2'),
    errorType?: string(name='ErrorType', example='ErrorType'),
    firstVersion?: string(name='FirstVersion', example='1.0.0'),
    gmtCreate?: long(name='GmtCreate', example='1673423227000'),
    gmtLatest?: long(name='GmtLatest', example='1740489688615'),
    keyLine?: int32(name='KeyLine', example='1'),
    name?: string(name='Name'),
    stack?: string(name='Stack', example='java.lang.NullPointerException'),
    status?: int32(name='Status', example='SUCCESS'),
    summary?: string(name='Summary', example='trustee instance'),
    symbolicStatus?: boolean(name='SymbolicStatus', example='true'),
    tags?: [ string ](name='Tags'),
  }(name='Model'),
  requestId?: string(name='RequestId', example='A8313212-EB4E-4E15-A7F9-D9C8F3FE8E94'),
  success?: boolean(name='Success', example='True'),
}

model GetIssueResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetIssueResponseBody(name='body'),
}

/**
 * @summary 获取聚合错误详情
 *
 * @param tmpReq GetIssueRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetIssueResponse
 */
async function getIssueWithOptions(tmpReq: GetIssueRequest, runtime: Util.RuntimeOptions): GetIssueResponse {
  Util.validateModel(tmpReq);
  var request = new GetIssueShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.filter)) {
    request.filterShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.filter, 'Filter', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appKey)) {
    body['AppKey'] = request.appKey;
  }
  if (!Util.isUnset(request.bizModule)) {
    body['BizModule'] = request.bizModule;
  }
  if (!Util.isUnset(request.digestHash)) {
    body['DigestHash'] = request.digestHash;
  }
  if (!Util.isUnset(request.filterShrink)) {
    body['Filter'] = request.filterShrink;
  }
  if (!Util.isUnset(request.os)) {
    body['Os'] = request.os;
  }
  var bodyFlat : map[string]any = {};
  if (!Util.isUnset(request.timeRange)) {
    bodyFlat['TimeRange'] = request.timeRange;
  }
  body = {
    ...body,
    ...OpenApiUtil.query(bodyFlat),
  };

  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetIssue',
    version = '2019-06-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取聚合错误详情
 *
 * @param request GetIssueRequest
 * @return GetIssueResponse
 */
async function getIssue(request: GetIssueRequest): GetIssueResponse {
  var runtime = new Util.RuntimeOptions{};
  return getIssueWithOptions(request, runtime);
}

model GetIssuesRequest {
  appKey?: long(name='AppKey', description='This parameter is required.', example='233588686'),
  bizModule?: string(name='BizModule', description='This parameter is required.', example='h5Resource'),
  filter?: {
    key?: string(name='Key', example='erConfig'),
    operator?: string(name='Operator', example='BeginWith'),
    subFilters?: [ string ](name='SubFilters'),
    values?: [ any ](name='Values'),
  }(name='Filter'),
  name?: string(name='Name', example='GUI-TEST1711072832000'),
  orderBy?: string(name='OrderBy', example='instances'),
  orderType?: string(name='OrderType', example='1'),
  os?: string(name='Os', example='h5'),
  pageIndex?: int32(name='PageIndex', example='1'),
  pageSize?: int32(name='PageSize', example='30'),
  status?: int32(name='Status', example='FE_RUNNING'),
  timeRange?: {
    endTime?: long(name='EndTime', example='2024-09-04T02:15:00Z'),
    granularity?: int32(name='Granularity', example='Host'),
    granularityUnit?: string(name='GranularityUnit', example='day'),
    startTime?: long(name='StartTime', example='2024-11-05T16:00:00Z'),
  }(name='TimeRange', description='This parameter is required.'),
}

model GetIssuesShrinkRequest {
  appKey?: long(name='AppKey', description='This parameter is required.', example='233588686'),
  bizModule?: string(name='BizModule', description='This parameter is required.', example='h5Resource'),
  filterShrink?: string(name='Filter'),
  name?: string(name='Name', example='GUI-TEST1711072832000'),
  orderBy?: string(name='OrderBy', example='instances'),
  orderType?: string(name='OrderType', example='1'),
  os?: string(name='Os', example='h5'),
  pageIndex?: int32(name='PageIndex', example='1'),
  pageSize?: int32(name='PageSize', example='30'),
  status?: int32(name='Status', example='FE_RUNNING'),
  timeRange?: {
    endTime?: long(name='EndTime', example='2024-09-04T02:15:00Z'),
    granularity?: int32(name='Granularity', example='Host'),
    granularityUnit?: string(name='GranularityUnit', example='day'),
    startTime?: long(name='StartTime', example='2024-11-05T16:00:00Z'),
  }(name='TimeRange', description='This parameter is required.'),
}

model GetIssuesResponseBody = {
  args?: map[string]any(name='Args', description='Args'),
  errorCode?: int32(name='ErrorCode', example='200'),
  message?: string(name='Message', example='successful'),
  model?: {
    items?: [ 
      {
        affectedUserCount?: int32(name='AffectedUserCount', example='1'),
        digestHash?: string(name='DigestHash', example='-3481243636390427020'),
        domScore?: string(name='DomScore', example='1'),
        errorColumn?: int32(name='ErrorColumn', example='1'),
        errorCount?: int32(name='ErrorCount', example='2'),
        errorDeviceCount?: int32(name='ErrorDeviceCount', example='1'),
        errorDeviceRate?: double(name='ErrorDeviceRate', example='1.0'),
        errorFileName?: string(name='ErrorFileName', example='test.js'),
        errorLine?: int32(name='ErrorLine', example='1'),
        errorName?: string(name='ErrorName', example='ErrorName'),
        errorRate?: double(name='ErrorRate', example='0'),
        errorType?: string(name='ErrorType', example='Error'),
        eventTime?: string(name='EventTime', example='1691745496851'),
        firstVersion?: string(name='FirstVersion', example='1.0.0'),
        name?: string(name='Name', example='ServiceType'),
        stack?: string(name='Stack', example='java.lang.NullPointerException: Attempt to invoke virtual method \\\\"java.lang.Object java.lang.ref.WeakReference.get()\\\\" on a null object reference
	at e.l.a.a.d.h(BasePresenter.java:1)
	at e.l.a.g.c.e.g.s1(GoodsPigLoadPresenter.java:1)
	at e.l.a.h.d.a$a.a(AliOssManager.java:2)'),
        status?: int32(name='Status', example='CREATE_COMPLETE'),
      }
    ](name='Items'),
    pageNum?: int32(name='PageNum', example='2'),
    pageSize?: int32(name='PageSize', example='10'),
    pages?: int32(name='Pages', example='1'),
    total?: long(name='Total', example='0'),
  }(name='Model'),
  requestId?: string(name='RequestId', example='22111548-55D2-4258-9B18-273E4C134444'),
  success?: boolean(name='Success', example='True'),
}

model GetIssuesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetIssuesResponseBody(name='body'),
}

/**
 * @summary 获取聚合错误列表
 *
 * @param tmpReq GetIssuesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetIssuesResponse
 */
async function getIssuesWithOptions(tmpReq: GetIssuesRequest, runtime: Util.RuntimeOptions): GetIssuesResponse {
  Util.validateModel(tmpReq);
  var request = new GetIssuesShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.filter)) {
    request.filterShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.filter, 'Filter', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appKey)) {
    body['AppKey'] = request.appKey;
  }
  if (!Util.isUnset(request.bizModule)) {
    body['BizModule'] = request.bizModule;
  }
  if (!Util.isUnset(request.filterShrink)) {
    body['Filter'] = request.filterShrink;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.orderBy)) {
    body['OrderBy'] = request.orderBy;
  }
  if (!Util.isUnset(request.orderType)) {
    body['OrderType'] = request.orderType;
  }
  if (!Util.isUnset(request.os)) {
    body['Os'] = request.os;
  }
  if (!Util.isUnset(request.pageIndex)) {
    body['PageIndex'] = request.pageIndex;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.status)) {
    body['Status'] = request.status;
  }
  var bodyFlat : map[string]any = {};
  if (!Util.isUnset(request.timeRange)) {
    bodyFlat['TimeRange'] = request.timeRange;
  }
  body = {
    ...body,
    ...OpenApiUtil.query(bodyFlat),
  };

  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetIssues',
    version = '2019-06-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取聚合错误列表
 *
 * @param request GetIssuesRequest
 * @return GetIssuesResponse
 */
async function getIssues(request: GetIssuesRequest): GetIssuesResponse {
  var runtime = new Util.RuntimeOptions{};
  return getIssuesWithOptions(request, runtime);
}

model GetSymbolicFilesRequest {
  appKey?: long(name='AppKey', description='appKey

This parameter is required.', example='24780725'),
  appVersion?: string(name='AppVersion', example='1.0'),
  endTime?: long(name='EndTime', example='1743523199999'),
  exportStatus?: string(name='ExportStatus', example='NORMAL'),
  fileName?: string(name='FileName', example='app_so.zip'),
  fileType?: string(name='FileType', description='This parameter is required.', example='APP_SO'),
  os?: string(name='Os', description='This parameter is required.', example='android'),
  pageIndex?: int32(name='PageIndex', description='This parameter is required.', example='1'),
  pageSize?: int32(name='PageSize', description='This parameter is required.', example='10'),
  startTime?: long(name='StartTime', example='1742918400000'),
  uuid?: string(name='Uuid', description='uuid', example='abcf4a4b-158c-4a0b-b81c-262785d84c4f'),
}

model GetSymbolicFilesResponseBody = {
  args?: map[string]any(name='Args', description='Args'),
  errorCode?: int32(name='ErrorCode', example='200'),
  message?: string(name='Message', example='successful'),
  model?: {
    items?: [ 
      {
        appVersion?: string(name='AppVersion', example='1.0.0'),
        buildId?: string(name='BuildId', example='e8a1a2b9ab653780b34383a942ac91b2'),
        exportStatus?: string(name='ExportStatus', example='EXPORT_SUCCESS'),
        fileName?: string(name='FileName', example='app_so.zip'),
        filePath?: string(name='FilePath', example='24781204@android/1743506690915-app_so.zip'),
        fileType?: string(name='FileType', example='APP_SO'),
        gmtCreate?: long(name='GmtCreate', example='1655962713000'),
        id?: long(name='Id', example='392522'),
        status?: string(name='Status', example='NORMAL'),
        uuid?: string(name='Uuid', description='uuid', example='9634758587856312DEV'),
      }
    ](name='Items'),
    pageNum?: int32(name='PageNum', example='1'),
    pageSize?: int32(name='PageSize', example='10'),
    pages?: int32(name='Pages', example='3'),
    total?: long(name='Total', example='30'),
  }(name='Model'),
  requestId?: string(name='RequestId', description='requestId', example='B3AD0FE4-36EF-1641-90B1-77618166F2ff'),
  success?: boolean(name='Success', example='true'),
}

model GetSymbolicFilesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetSymbolicFilesResponseBody(name='body'),
}

/**
 * @param request GetSymbolicFilesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetSymbolicFilesResponse
 */
async function getSymbolicFilesWithOptions(request: GetSymbolicFilesRequest, runtime: Util.RuntimeOptions): GetSymbolicFilesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.appKey)) {
    body['AppKey'] = request.appKey;
  }
  if (!Util.isUnset(request.appVersion)) {
    body['AppVersion'] = request.appVersion;
  }
  if (!Util.isUnset(request.endTime)) {
    body['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.exportStatus)) {
    body['ExportStatus'] = request.exportStatus;
  }
  if (!Util.isUnset(request.fileName)) {
    body['FileName'] = request.fileName;
  }
  if (!Util.isUnset(request.fileType)) {
    body['FileType'] = request.fileType;
  }
  if (!Util.isUnset(request.os)) {
    body['Os'] = request.os;
  }
  if (!Util.isUnset(request.pageIndex)) {
    body['PageIndex'] = request.pageIndex;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.startTime)) {
    body['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.uuid)) {
    body['Uuid'] = request.uuid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetSymbolicFiles',
    version = '2019-06-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request GetSymbolicFilesRequest
 * @return GetSymbolicFilesResponse
 */
async function getSymbolicFiles(request: GetSymbolicFilesRequest): GetSymbolicFilesResponse {
  var runtime = new Util.RuntimeOptions{};
  return getSymbolicFilesWithOptions(request, runtime);
}

model RequestUploadTokenRequest {
  appKey?: long(name='AppKey', description='appKey

This parameter is required.', example='24780725'),
  os?: string(name='Os', description='This parameter is required.', example='android'),
}

model RequestUploadTokenResponseBody = {
  args?: map[string]any(name='Args', description='Args'),
  errorCode?: int32(name='ErrorCode', example='200'),
  message?: string(name='Message', example='Successful'),
  model?: {
    accessKeyId?: string(name='AccessKeyId', description='OSS AccessKeyId', example='STS.NXEGHKdjkdnINNgLiDE'),
    accessKeySecret?: string(name='AccessKeySecret', description='OSS AccessKeySecret', example='ikKgkNDGedInGEIngL'),
    endpoint?: string(name='Endpoint', example='oss-cn-shanghai.aliyuncs.com'),
    securityToken?: string(name='SecurityToken', example='Szi9v92mHNikdknfe'),
    uploadBucket?: string(name='UploadBucket', example='symbolic-prod'),
    uploadDir?: string(name='UploadDir', example='/335374903@iphoneos/'),
  }(name='Model'),
  requestId?: string(name='RequestId', example='AB8AB5EC-9636-421D-AE7C-BB227DFC95B0'),
  success?: boolean(name='Success', example='True'),
}

model RequestUploadTokenResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RequestUploadTokenResponseBody(name='body'),
}

/**
 * @param request RequestUploadTokenRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RequestUploadTokenResponse
 */
async function requestUploadTokenWithOptions(request: RequestUploadTokenRequest, runtime: Util.RuntimeOptions): RequestUploadTokenResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.appKey)) {
    body['AppKey'] = request.appKey;
  }
  if (!Util.isUnset(request.os)) {
    body['Os'] = request.os;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'RequestUploadToken',
    version = '2019-06-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request RequestUploadTokenRequest
 * @return RequestUploadTokenResponse
 */
async function requestUploadToken(request: RequestUploadTokenRequest): RequestUploadTokenResponse {
  var runtime = new Util.RuntimeOptions{};
  return requestUploadTokenWithOptions(request, runtime);
}

model SubmitSymbolicRequest {
  appKey?: long(name='AppKey', description='appKey

This parameter is required.', example='24781204'),
  appVersion?: string(name='AppVersion', example='1.0'),
  buildId?: string(name='BuildId', example='ab6b81d800968f2'),
  fileName?: string(name='FileName', description='This parameter is required.', example='app_so.zip'),
  filePath?: string(name='FilePath', description='This parameter is required.', example='24781204@android/1743506690915-app_so.zip'),
  fileType?: string(name='FileType', description='This parameter is required.', example='APP_SO'),
  os?: string(name='Os', description='This parameter is required.', example='android'),
  uuid?: string(name='Uuid', description='uuid', example='abcf4a4b-158c-4a0b-b81c-262785d84c4f'),
}

model SubmitSymbolicResponseBody = {
  args?: map[string]any(name='Args', description='args'),
  errorCode?: int32(name='ErrorCode', example='500'),
  message?: string(name='Message', example='Successful'),
  requestId?: string(name='RequestId', example='B3AD0FE4-36EF-1641-90B1-77618166F2ff'),
  success?: boolean(name='Success', example='True'),
}

model SubmitSymbolicResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SubmitSymbolicResponseBody(name='body'),
}

/**
 * @param request SubmitSymbolicRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SubmitSymbolicResponse
 */
async function submitSymbolicWithOptions(request: SubmitSymbolicRequest, runtime: Util.RuntimeOptions): SubmitSymbolicResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.appKey)) {
    body['AppKey'] = request.appKey;
  }
  if (!Util.isUnset(request.appVersion)) {
    body['AppVersion'] = request.appVersion;
  }
  if (!Util.isUnset(request.buildId)) {
    body['BuildId'] = request.buildId;
  }
  if (!Util.isUnset(request.fileName)) {
    body['FileName'] = request.fileName;
  }
  if (!Util.isUnset(request.filePath)) {
    body['FilePath'] = request.filePath;
  }
  if (!Util.isUnset(request.fileType)) {
    body['FileType'] = request.fileType;
  }
  if (!Util.isUnset(request.os)) {
    body['Os'] = request.os;
  }
  if (!Util.isUnset(request.uuid)) {
    body['Uuid'] = request.uuid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'SubmitSymbolic',
    version = '2019-06-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request SubmitSymbolicRequest
 * @return SubmitSymbolicResponse
 */
async function submitSymbolic(request: SubmitSymbolicRequest): SubmitSymbolicResponse {
  var runtime = new Util.RuntimeOptions{};
  return submitSymbolicWithOptions(request, runtime);
}

